//
//  BottomView.m
//  MyTravel
//
//  Created by Hunk on 11-6-10.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "BottomView.h"
#import <QuartzCore/QuartzCore.h>

@implementation BottomView

- (id)initWithFrame:(CGRect)frame name:(NSString*)name
{
    self = [super initWithFrame:frame];
    if (self) 
    {
        [self setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.7f]];
        self.alpha = 1.0f;
        self.layer.cornerRadius = 8.0f;
        self.layer.masksToBounds = YES;
        
        // Name label
        UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(frame.origin.x, 0, frame.size.width, frame.size.height)];
        [label setBackgroundColor:[UIColor clearColor]];
        [label setTextAlignment:UITextAlignmentCenter];
        [label setTextColor:[UIColor whiteColor]];
        [label setFont:[UIFont systemFontOfSize:16]];
        [label setText:name];
        [self addSubview:label];
        [label release];
        
    }
    return self;
}

- (void)bottomViewWillAppear
{
    [UIView beginAnimations:@"View Will Appear" context:nil];
    [UIView setAnimationDuration:1.0f];
    [self setAlpha:0.0];
    [UIView commitAnimations];
}

- (void)bottomViewWillAppearWithDuration:(CGFloat)duration
{
    [UIView beginAnimations:@"View Will Appear" context:nil];
    [UIView setAnimationDuration:duration];
    [self setAlpha:0.0];
    [UIView commitAnimations];
}

- (void)dealloc
{
    [super dealloc];
}

@end
